package cn.yunhe.biz;

import cn.yunhe.bean.Comment;
import cn.yunhe.dao.CommentMapper;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class CommentService {
    SqlSession session=SqlSessionFactoryUtil.getSqlSession();
    CommentMapper commentMapper = session.getMapper(CommentMapper.class);
    public int insertHotelComment(Comment comment){
        int flag= commentMapper.insertHotelComment( comment);
        session.commit();
        return flag;
    }
    public List<Comment> getHotelCommentById(int id){
        return commentMapper.getHotelCommentById(id);
    }
}
